

ALLOWED_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'


def validuser( user ):
	for a in user:
		if a not in ALLOWED_CHARS:
			return False
	return True

def validgroup( group ):
	return validuser( group )

def filteruser( user ):
	out = ''
	for a in user:
		if a in ALLOWED_CHARS:
			out += a
	return out

def filtergroup( group ):
	return filteruser( group )



